<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib 	prefix="s" 			uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
<script type="text/javascript" src="/inc/css/common.js"></script>

<title>근태관리 LOGIN</title>

	<script type="text/javascript">
		//로그인 버튼
		function fnc_login(f) {
			if (!fnc_validate(f)) {
				return false;
			}
			
			f.action = "loginTry.action";
			f.submit();
			
			return false;
		}
		
		function fnc_logout(f) {
			if (!confirm("<s:text name="alert.message.confirmLogout" />")) {
				return false;
			}
			
			f.action = "logout.action";
			f.submit();
			
		}
		
		//폼입력값 검사
		function fnc_validate(f) {
			var id		=	f.user_id.value;
			var pass	=	f.pass.value;
			
			if (id.replace(/^\s\s*/, '').replace(/\s\s*$/, '').length < 1 ) {
				alert("<s:text name="alert.message.invalidID" />");
				f.user_id.focus();
				return false;
			} else if (pass.replace(/^\s\s*/, '').replace(/\s\s*$/, '').length < 1) {
				alert("<s:text name="alert.message.invalidPassword" />");
				f.pass.focus();
				return false;
			} else {
				return true;
			}
		}

		function fnc_onload() {
			var message = "<s:property value="msg" />";
			if ( message != "") {
				alert(message);
			}

			var id = document.frm.user_id.value;
			
			if ( id.replace(/^\s\s*/, '').replace(/\s\s*$/, '').length > 0 ) {
				document.frm.pass.focus();
			} else {
				document.frm.user_id.focus();
			}
		}
	</script>
</head>
<body onload="fnc_onload()">
	<form name="frm" method="post"  >
		<!---------- LOGIN BOX : STR---------->
		<div id="login" >
			<div id="login_logo"><img src="/images/login_logo.gif"/></div>
			<div id="login_box">
				<div id="login_input">
					<div class="fl_le">
						<ul><li><input type="text" 		class="login_input" style="ime-mode:inactive" name="user_id" 	maxlength="10" value="<s:property value="user_id" />" /></li></ul>
						<ul><li><input type="password" 	class="login_input" name="pass" 	maxlength="10" /></li></ul>
					</div>
					<div class="fl_ri"><input type="image" src="/images/login/login_btn.gif" onclick="return fnc_login(this.form)" /></div>
				</div>
			</div>
		</div>
		<!---------- LOGIN BOX : END---------->
		
	</form>
	<!---------------Bottom : STR----------->
	<div id="bottom2"><ul><li><img src="/images/bottom_img.gif" /></li></ul></div>
	<!---------------Bottom : END----------->
</body>
</html>